pub fn while_let_usage() {
    let mut optional = Some(0);
/*
    loop {
        match optional {
            Some(i) => {
                if i > 9 {
                    println!("Greater than 9, Quit");
                }else{
                    println!("`i` is {:?},Try again",i);
                }
                optional = None;
            },
            //解构失败时退出循环
            _=>{break;}
        }
    }
*/

    while let Some(i) = optional {
        if i > 9 {
            println!("Greater than 9, quit !");
            optional = None;
        }else{
            println!("`i` is `{:?}`,Try again.",i);
            optional = Some(i+1);//自变量递增
        }
    }
}